//
//  PaymentDetailsTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/6.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "PaymentDetailsTableViewCell.h"

@interface PaymentDetailsTableViewCell ()
{
    GLGWLabel *comeFromLab;
    GLGWLabel *tipaLab;
}
@end

@implementation PaymentDetailsTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];
        GLGWView *baView = [[GLGWView alloc] initWithInSuperView:self];
        [baView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(@(kHeightProportion_In_iPhoneTriploid(15)));
            make.left.equalTo(self).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.right.equalTo(self).offset(-kWidthProportion_In_iPhoneTriploid(15));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(101)));
        }];
        [baView setViewShadowWidth:6 theCornerRadius:6];
        baView.backgroundColor = [UIColor whiteColor];
        
        GLGWLabel *lab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:baView];
        lab.text = @"订单收支";
        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(baView).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(baView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(10));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(30)));
        }];
        
        GLGWLabel *waterListNumLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:baView];
        waterListNumLab.text = @"TX0014235411";
        [waterListNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(lab.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(8));
            make.right.equalTo(baView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(50));
            make.left.equalTo(lab.mas_left);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
        }];
        
        GLGWLabel *moneyLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:[UIColor colorWithHexString:@"#EC5353"] inSuperView:baView];
        NSString *str = @" ¥3030";
        //        moneyLab.text = @"¥3030";
       NSAttributedString *att = [GLGWLabel bllChangeStr:str changewithStr:@"¥" changeColoer:[UIColor colorWithHexString:@"#EC5353"] withFont:SYSTEMFONT(12)];
       NSMutableAttributedString *att2 = [GLGWLabel bllChangeStr:@"+" changewithStr:@"+" changeColoer:[UIColor colorWithHexString:@"#EC5353"] withFont:SYSTEMFONT(14)];
        [moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(baView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(26));
            make.bottom.equalTo(baView.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(14));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        
        [att2 appendAttributedString:att];
        moneyLab.attributedText = att2;
        
        GLGWLabel *timeLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:baView];
        timeLab.text = @"2018-08-21 12:12:12";
        [timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.lessThanOrEqualTo(moneyLab.mas_left).offset(-kWidthProportion_In_iPhoneTriploid(5));
            make.top.equalTo(waterListNumLab.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(6));
            make.left.equalTo(waterListNumLab.mas_left);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
        }];
        
        GLGWLabel *tipLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#EC5353"] inSuperView:baView];
        tipLab.text = @"收入";
        [tipLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(moneyLab.mas_right);
            make.bottom.equalTo(moneyLab.mas_top).offset(-kHeightProportion_In_iPhoneTriploid(3));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
        }];
        tipaLab = tipLab;
        
        GLGWLabel *comeLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:baView];
        comeLab.text = @"支付宝 >";
        [comeLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(baView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(13));
            make.top.equalTo(baView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(19));
        }];
        comeFromLab = comeLab;
        comeLab.textAlignment = NSTextAlignmentRight;
    }
    return self;
}

- (void)setComeStr:(NSString *)comeStr
{
    _comeStr = comeStr;
    comeFromLab.text = comeStr;
}

- (void)setTipStr:(NSString *)tipStr
{
    _tipStr = tipStr;
    tipaLab.text = tipStr;
}

- (void)setMoneyLab:(GLGWLabel *)moneyLab
{
    _moneyLab = moneyLab;
}
@end
